﻿namespace Ocelot.Admin.Api.Application
{
    public interface IRouteService
    {
        /// <summary>
        /// 预览路由信息
        /// </summary>
        /// <returns></returns>
        Task<string> GetRoutePreviewAsync();

        /// <summary>
        /// 分页查询项目信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<SqlSugarPagedList<PageRouteResponse>> GetPageRouteAsync(PageRouteRequest request);
        /// <summary>
        /// 查询路由具体信息
        /// </summary>
        /// <param name="projectIds">项目Id集合</param>
        /// <returns></returns>
        Task<List<RouteDto>> GetRouteByProjectIdsAsync(List<int> projectIds);

        /// <summary>
        /// 查询路由具体信息
        /// </summary>
        /// <param name="routeId"></param>
        /// <returns></returns>
        Task<RouteDto> GetRouteAsync(int routeId);

        #region 新增

        /// <summary>
        /// 新增路由信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<int> InsertRouteAsync(RouteDto request);

        #endregion

        #region 编辑

        /// <summary>
        /// 更新路由信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<int> UpdateRouteAsync(RouteDto request);

        /// <summary>
        /// 启用或禁用路由信息
        /// </summary>
        /// <param name="routeId">路由Id</param>
        /// <param name="enabled">是否有效</param>
        /// <returns></returns>
        Task<string> PatchRouteAsync(int routeId, bool enabled);

        #endregion

        /// <summary>
        /// 删除路由信息
        /// </summary>
        /// <param name="routeId">路由Id</param>
        /// <returns></returns>
        Task<string> DeleteRouteAsync(int routeId);
    }
}